<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags"%>
<html>
<head>
	<tag:header />
</head>
<body id="main_layout">

<div id="tt" class="easyui-tabs" style="width: 100%;height: 800px;">

	<div title="会员">
		<div style="margin: 5px;">总记录数:<span id="grid1RowCount" style="color: blue"></span></div>
		<table id="grid1" rownumbers="true" fitcolumns="true" singleselect="false">
			<thead>
			<tr>
				<th field="CHECKCITYNAME" width="200">办事处</th>
				<th field="REALNAME" width="200">会员姓名</th>
				<th field="MOBILEPHONE" width="200">会员电话</th>
				<th field="REGISTERCHANNELNAME" width="200">注册渠道</th>
				<th field="REGISTERTYPENAME" width="200">注册方式</th>
				<th field="ORDERQTY" width="200">购买次数</th>
				<th field="BABYQTY" width="200">宝宝数量</th>
				<th field="TOTALSCORE" width="200">总积分</th>
				<th field="USEDSCORE" width="200">已用积分</th>
				<th field="CURRSCORE" width="200">未用积分</th>
				<th field="USERTYPENAME" width="200">推荐人类型</th>
				<th field="ADDBYREALNAME" width="200">推荐人姓名</th>
				<th field="CELLPHONE" width="200">推荐人电话</th>
				<th field="ADDTIME" width="300">注册时间</th>
			</tr>
			</thead>
			<tbody id="memberItems">
			</tbody>
		</table>

	</div>
	<div title="推荐人">
		<div style="margin: 5px;">总记录数:<span id="grid2RowCount" style="color: blue"></span></div>
		<table id="grid2" rownumbers="true" fitcolumns="true" singleselect="false">
			<thead>
			<tr>
				<th field="REGIONNAME" width="200">办事处</th>
				<th field="REALNAME" width="200">推荐人姓名</th>
				<th field="CELLPHONE" width="200">推荐人电话</th>
				<th field="USERTYPENAME" width="200">推荐人类型</th>
				<th field="EQUIPMENTMODEL" width="200">设备型号</th>
				<th field="EQUIPMENTID" width="200">设备标识</th>
				<th field="OPERATIONSTEPSNAME" width="200">验证步骤</th>
				<th field="USERSTATUSNAME" width="200">账户状态</th>
				<th field="ADDTIME" width="300">增加时间</th>
				<th field="UNBUNDLINGQTY" width="200">解绑次数</th>
				<th field="STORENUM" width="200">门店数量</th>
			</tr>
			</thead>
			<tbody id="recommenderItems">
			</tbody>
		</table>
	</div>
	<div title="外勤人员">
		<div style="margin: 5px;">总记录数:<span id="grid3RowCount" style="color: blue"></span></div>
		<table id="grid3" rownumbers="true" fitcolumns="true" singleselect="false">
			<thead>
			<tr>
				<th field="EMPNO" width="200">员工号</th>
				<th field="USERNAME" width="200">员工帐号</th>
				<th field="REALNAME" width="200">员工姓名</th>
				<th field="USERTYPENAME" width="200">员工类型</th>
				<th field="SEXNAME" width="200">性别</th>
				<th field="DEPTNAME" width="200">部门名称</th>
				<th field="POSTNAME" width="200">部门职务</th>
				<th field="PARENTUSERNAME" width="200">汇报对象</th>
				<th field="USERSTATUSNAME" width="200">账户状态</th>
				<th field="CELLPHONE" width="200">手机号</th>
				<th field="EQUIPMENTMODEL" width="200">设备型号</th>
				<th field="EQUIPMENTID" width="200">设备标识</th>
				<th field="OPERATIONSTEPSNAME" width="200">验证步骤</th>
			</tr>
			</thead>
			<tbody id="staffItems">
			</tbody>
		</table>
	</div>
</div>
</body>

<script>

    $(function(){

        var id = '<%=request.getParameter("id")%>';
        var sendTarget = '<%=request.getParameter("sendTarget")%>';

        if(sendTarget.indexOf("1") != -1){
            $('#grid1').datagrid({
                url: '${pageContext.request.contextPath}/api/ebms/surveyInfo/getMemberDetails',
                queryParams: {
                    id: id
                },onLoadSuccess: function(data){
                    $('#grid1RowCount').text(data.total);
                }
            });
        }

        if(sendTarget.indexOf(2) != -1) {
            $('#grid2').datagrid({
                url: '${pageContext.request.contextPath}/api/ebms/surveyInfo/getRecommenderDetails',
                queryParams: {
                    id: id
                }, onLoadSuccess: function (data) {
                    $('#grid2RowCount').text(data.total);
                }
            });
        }

        if(sendTarget.indexOf(3) != -1) {
            $('#grid3').datagrid({
                url: '${pageContext.request.contextPath}/api/ebms/surveyInfo/getStaffDetails',
                queryParams: {
                    id: id
                }, onLoadSuccess: function (data) {
                    $('#grid3RowCount').text(data.total);
                }
            });
        }

        if(sendTarget.indexOf(1) == -1){
            $('#tt').tabs('close', '会员');
        }
        if(sendTarget.indexOf(2) == -1){
            $('#tt').tabs('close', '推荐人');
        }
        if(sendTarget.indexOf(3) == -1){
            $('#tt').tabs('close', '外勤人员');
        }

    });


</script>
</html>
